package com.tmzn.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tmzn.db.DataSource;
import com.tmzn.db.DataSourceType;
import com.tmzn.domain.TPlanRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface TDeviceRecordMapper extends BaseMapper<TPlanRecord> {

    @Select("${cw}")
    Map<String,Object> getDeviceData(@Param("cw")String cw);

    @DataSource(value = DataSourceType.SLAVE)
    @Select("${cw}")
    Map<String,Object> getDeviceDataFromOri(@Param("cw")String cw);

    @Update("${cw}")
    int updateCommonSql(@Param("cw")String cw);

    @Select("${cw}")
    List<Map<String,Object>> selectCommonSql(@Param("cw")String cw);


    @Select("${cw}")
    Map<String,Object> selectCommonSqlOne(@Param("cw")String cw);
}
